import './App.css';
import {connect} from "react-redux"


function App(props) {
  return (
    <div className="App">===
     {props.ci}
     <p>
      <button onClick={()=>props.jia(2)}>+2</button>
      <button onClick={()=>props.jian(2)}>-2</button>
      </p>
    </div>
  );
}
const mapStateToProps=(state)=>{
  return {
    'ci':state
  }
}
const mapDispatchToProps = (dispatch)=>{
return {
  "jia":(i)=>dispatch({type:"jia",n:i}),
  "jian":(i)=>dispatch({type:"jian",n:i})
}
}

export default  connect(mapStateToProps,mapDispatchToProps)(App);
